package com.fengze.business.service.impl;

import java.util.List;

import com.fengze.business.vo.SupplierLibrarySelectVO;
import com.fengze.business.vo.SupplierLibraryVO;
import com.fengze.common.annotation.AutoSetInsertValue;
import com.fengze.common.annotation.AutoSetUpdateValue;
import com.fengze.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fengze.business.mapper.SupplierLibraryMapper;
import com.fengze.business.domain.SupplierLibrary;
import com.fengze.business.service.ISupplierLibraryService;

/**
 * 供应商库Service业务层处理
 * 
 * @author lug
 * @date 2024-01-31
 */
@Service
public class SupplierLibraryServiceImpl implements ISupplierLibraryService 
{
    @Autowired
    private SupplierLibraryMapper supplierLibraryMapper;

    /**
     * 查询供应商库
     * 
     * @param id 供应商库主键
     * @return 供应商库
     */
    @Override
    public SupplierLibrary selectSupplierLibraryById(Long id)
    {
        return supplierLibraryMapper.selectSupplierLibraryById(id);
    }

    /**
     * 查询供应商库列表
     * 
     * @param supplierLibrary 供应商库
     * @return 供应商库
     */
    @Override
    public List<SupplierLibrary> selectSupplierLibraryList(SupplierLibrary supplierLibrary)
    {
        return supplierLibraryMapper.selectSupplierLibraryList(supplierLibrary);
    }

    @Override
    public List<SupplierLibraryVO> selectSupplierLibraryVOList(SupplierLibrary supplierLibrary) {


        return supplierLibraryMapper.selectSupplierLibraryVOList(supplierLibrary);
    }

    /**
     * 新增供应商库
     * 
     * @param supplierLibrary 供应商库
     * @return 结果
     */
    @AutoSetInsertValue
    @Override
    public int insertSupplierLibrary(SupplierLibrary supplierLibrary)
    {
        supplierLibrary.setCreateTime(DateUtils.getNowDate());
        return supplierLibraryMapper.insertSupplierLibrary(supplierLibrary);
    }

    /**
     * 修改供应商库
     * 
     * @param supplierLibrary 供应商库
     * @return 结果
     */
    @AutoSetUpdateValue
    @Override
    public int updateSupplierLibrary(SupplierLibrary supplierLibrary)
    {
        supplierLibrary.setUpdateTime(DateUtils.getNowDate());
        return supplierLibraryMapper.updateSupplierLibrary(supplierLibrary);
    }

    /**
     * 批量删除供应商库
     * 
     * @param ids 需要删除的供应商库主键
     * @return 结果
     */
    @Override
    public int deleteSupplierLibraryByIds(Long[] ids)
    {
        return supplierLibraryMapper.deleteSupplierLibraryByIds(ids);
    }

    /**
     * 删除供应商库信息
     * 
     * @param id 供应商库主键
     * @return 结果
     */
    @Override
    public int deleteSupplierLibraryById(Long id)
    {
        return supplierLibraryMapper.deleteSupplierLibraryById(id);
    }

    @Override
    public SupplierLibraryVO selectSupplierLibraryVOById(Long id) {
        return supplierLibraryMapper.selectVOById(id);
    }

    @Override
    public List<SupplierLibrarySelectVO> selectSelectVOList(SupplierLibrary supplierLibrary) {
        return supplierLibraryMapper.selectSelect(supplierLibrary);
    }
}
